package flc.ast.adapter;

import android.view.View;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.blankj.utilcode.util.ImageUtils;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.MyLocalAlbumItemBean;
import io.reactivex.rxjava3.core.ObservableEmitter;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;
import stark.common.basic.utils.MediaUtil;
import stark.common.basic.utils.RxUtil;
import stark.common.basic.utils.TimeUtil;

public class LocalAlbumItemAdapter extends StkProviderMultiAdapter<MyLocalAlbumItemBean> {

    public LocalAlbumItemAdapter() {
        addItemProvider(new StkSingleSpanProvider<>(125));
        addItemProvider(new LocalAlbumItemProvider());
    }

    private boolean isEdit = false;

    public void setEdit(boolean edit) {
        isEdit = edit;
    }

    private class LocalAlbumItemProvider extends BaseItemProvider<MyLocalAlbumItemBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_local_album_item;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, MyLocalAlbumItemBean bean) {
            Glide.with(getContext()).load(bean.getPath())
                    .into((ImageView) baseViewHolder.getView(R.id.ivLocalAlbumItemImg));
        }
    }
}
